<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="en" name="language">
	<title>attribute</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link media="screen" href="../docutils-api.css" type="text/css" rel="stylesheet">

</head>

<body>

<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
  <input type="hidden" name="domains" value="www.graphicsmagick.org" />
  <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" />&nbsp;<input type="submit" name="sa" value="Search" /></span>
</form>
</div>


<div class="navmenu">
<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../project.html">Project</a></li>
  <li><a href="../download.html">Download</a></li>
  <li><a href="../README.html">Install</a></li>
  <li><a href="../Hg.html">Source</a></li>
  <li><a href="../NEWS.html">News</a> </li>
  <li><a href="../utilities.html">Utilities</a></li>
  <li><a href="../programming.html">Programming</a></li>
  <li><a href="../reference.html">Reference</a></li>
</ul>
</div>

<main id="attribute">
<h1 class="title">attribute</h1>
<p class="subtitle" id="access-key-value-image-attributes">Access key,value image attributes</p>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#cloneimageattributes" id="id9">CloneImageAttributes</a></p></li>
<li><p><a class="reference internal" href="#destroyimageattributes" id="id10">DestroyImageAttributes</a></p></li>
<li><p><a class="reference internal" href="#getimageattribute" id="id11">GetImageAttribute</a></p></li>
<li><p><a class="reference internal" href="#getimageclippingpathattribute" id="id12">GetImageClippingPathAttribute</a></p></li>
<li><p><a class="reference internal" href="#setimageattribute" id="id13">SetImageAttribute</a></p></li>
</ul>
</div>
<section id="cloneimageattributes">
<h1><a class="toc-backref" href="#id9">CloneImageAttributes</a></h1>
<section id="synopsis">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail CloneImageAttributes( <a class="reference external" href="../api/types.html#image">Image</a> *clone_image,
                                     const <a class="reference external" href="../api/types.html#image">Image</a> *original_image );</pre>
</section>
<section id="description">
<h2>Description</h2>
<p>CloneImageAttributes() copies the text attributes from one image to another.
Any text attributes in the destination image are preserved.
CloneImageAttributes returns MagickPass if all of the attribututes are
successfully cloned or MagickFail if there is a memory allocation error.</p>
<p>The format of the CloneImageAttributes method is:</p>
<pre class="literal-block">MagickPassFail CloneImageAttributes( <a class="reference external" href="../api/types.html#image">Image</a> *clone_image,
                                     const <a class="reference external" href="../api/types.html#image">Image</a> *original_image );</pre>
<dl class="simple">
<dt>clone_image:</dt>
<dd><p>The destination image.</p>
</dd>
<dt>original_image:</dt>
<dd><p>The source image.</p>
</dd>
</dl>
</section>
</section>
<section id="destroyimageattributes">
<h1><a class="toc-backref" href="#id10">DestroyImageAttributes</a></h1>
<section id="id1">
<h2>Synopsis</h2>
<pre class="literal-block">DestroyImageAttributes( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id2">
<h2>Description</h2>
<p>DestroyImageAttributes() deallocates memory associated with the image
attribute list.</p>
<p>The format of the DestroyImageAttributes method is:</p>
<pre class="literal-block">DestroyImageAttributes( <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
<section id="getimageattribute">
<h1><a class="toc-backref" href="#id11">GetImageAttribute</a></h1>
<section id="id3">
<h2>Synopsis</h2>
<pre class="literal-block">const ImageAttribute *GetImageAttribute( const <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *key );</pre>
</section>
<section id="id4">
<h2>Description</h2>
<p>GetImageAttribute() searches the list of image attributes and returns
a pointer to the attribute if it exists otherwise NULL.</p>
<p>The format of the GetImageAttribute method is:</p>
<pre class="literal-block">const ImageAttribute *GetImageAttribute( const <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *key );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>key:</dt>
<dd><p>These character strings are the name of an image attribute to
return.</p>
</dd>
</dl>
</section>
</section>
<section id="getimageclippingpathattribute">
<h1><a class="toc-backref" href="#id12">GetImageClippingPathAttribute</a></h1>
<section id="id5">
<h2>Synopsis</h2>
<pre class="literal-block">const ImageAttribute *GetImageClippingPathAttribute( const <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
</section>
<section id="id6">
<h2>Description</h2>
<p>Method GetImageClippingPathAttribute searches the list of image attributes
and returns a pointer to a clipping path if it exists otherwise NULL.</p>
<p>The format of the GetImageClippingPathAttribute method is:</p>
<pre class="literal-block">const ImageAttribute *GetImageClippingPathAttribute( const <a class="reference external" href="../api/types.html#image">Image</a> *image );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>attribute:</dt>
<dd><p>Method GetImageClippingPathAttribute returns the clipping
path if it exists otherwise NULL.</p>
</dd>
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
</dl>
</section>
</section>
<section id="setimageattribute">
<h1><a class="toc-backref" href="#id13">SetImageAttribute</a></h1>
<section id="id7">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int SetImageAttribute( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *key, const char *value );</pre>
</section>
<section id="id8">
<h2>Description</h2>
<p>SetImageAttribute() searches the list of image attributes and replaces the
attribute value.  If it is not found in the list, the attribute name
and value is added to the list.   If the attribute exists in the list,
the value is concatenated to the attribute.  SetImageAttribute returns
True if the attribute is successfully concatenated or added to the list,
otherwise False.  If the value is NULL, the matching key is deleted
from the list.</p>
<p>There is special handling for the EXIF:Orientation attribute. Setting this
attribute will also update the EXIF tag in the image's EXIF profile to the
given value provided an EXIF profile exists and has an existing EXIF
orientation tag and the attribute value is a valid orientation
(see orientationType). The attribute value will be set regardless of
whether the EXIF profile was successfully updated. The new
EXIF:Orientation attribute replaces the existing value rather than
being concatenated to it as when setting other attributes.</p>
<p>The 'comment' and 'label' attributes are treated specially in that
embedded format specifications are translated according to the formatting
rules of TranslateText().</p>
<p>The format of the SetImageAttribute method is:</p>
<pre class="literal-block">unsigned int SetImageAttribute( <a class="reference external" href="../api/types.html#image">Image</a> *image, const char *key, const char *value );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>key,value:</dt>
<dd><p>These character strings are the name and value of an image
attribute to replace or add to the list.</p>
</dd>
</dl>
</section>
</section>
</main>


<hr class="docutils">
<div class="document">
    <p><a href="../Copyright.html">Copyright</a> © GraphicsMagick Group 2002-2025<!--SPONSOR_LOGO--></p>
</div>

</main>
</body>
</html>
